from typing import List

from app.repository.school_repo import SchoolInfoRepository


class SchoolInfoService:
    @staticmethod
    async def get_schoolInfo_by_id(school_id: int):
        result = await SchoolInfoRepository.find_by_id(school_id)
        return result

    @staticmethod
    async def find_schools_by_filters(
            is_985: bool = False,
            is_211: bool = False,
            is_dfc: bool = False,
            is_imp_country: bool = False,
            filter_city: List[str] = None,  # 将参数名改为 filter_city，类型改为 List[str]
            school_name: str = None
    ):
        result = await SchoolInfoRepository.find_all_schools(is_985, is_211, is_dfc, is_imp_country, filter_city,
                                                             school_name)
        return result

    @staticmethod
    async def find_school_rank(rank_type: str):
        result = await SchoolInfoRepository.find_school_by_rank(rank_type)
        return result

    @staticmethod
    async def find_all_province():
        result = await SchoolInfoRepository.get_all_provinces()
        return result

    @staticmethod
    async def get_titles_by_school(school_id: int):
        return await SchoolInfoRepository.find_titles_by_school(school_id)

    @staticmethod
    async def get_content_by_id(brochure_id: int):
        return await SchoolInfoRepository.find_content_by_id(brochure_id)

    @staticmethod
    async def get_plans_by_nature(school_name: str, nature: str == None):
        return await SchoolInfoRepository.get_plans_by_nature(school_name, nature)

    @staticmethod
    async def get_score_by_id(school_id: int):
        return await SchoolInfoRepository.get_score_by_id(school_id)
